home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
DEV
/
A-B
/
add images.cpt
/
about_alert.c
< prev
next >
Wrap
Text File
|
1989-06-22
|
2KB
|
111 lines
/* *******************************
File: about_alert.c
Function: Handle all operations for this Alert
History: 4/27/89 Original by Prototyper.
4/27/89 Modified by c. keith ray
This is a NOTE alert, it is used to inform the user of some general information.
This alert is not used if there is a possibility of losing any data.
******************************* */
#include "about_alert.h"
#include <IM1_5Protos.h>
/* *********************************** */
/* These are the other includes for general routines */
/* #include <Strings.h> */
extern char *strcpy (Str255 *, char *); /* LSC string prototype */
/* *********************************** */
#define TRUE 1
#define FALSE 0
#define NIL 0
/* *********************************** */
void A_about_alert ()
{
#define I_OK 1
#define I_x 2
#define I_x3 3
short itemHit;
/* Let the OS handle the Alert and wait for a result to be returned */
itemHit = NoteAlert (about_alert_id, NIL);
/* This is a button that may have been pressed. */
if (I_OK == itemHit)
{
}
}
#define I_What_can_you_do 1
#define I_text 2
#define I_outtext 3
/* ======================================================== */
void D_error_alert(err_num)
long err_num;
{
char ExitDialog;
DialogPtr GetSelection;
Handle DItem;
Rect tempRect;
short DType;
short itemHit;
char err_string[255];
GrafPtr saveport;
GetPort(&saveport);
GetSelection = GetNewDialog(error_dialog_id, NIL, (WindowPtr)-1);
ShowWindow(GetSelection);
SelectWindow(GetSelection);
SetPort(GetSelection);
/* Setup initial conditions */
NumToString( err_num, (char *)&err_string );
GetDItem (GetSelection, I_outtext, &DType, &DItem, &tempRect);
SetIText (DItem, (char *)&err_string);
ExitDialog = FALSE;
do
{
ModalDialog(NIL, &itemHit);
GetDItem(GetSelection, itemHit, &DType, &DItem, &tempRect);
/* Handle it real time */
if (itemHit == I_What_can_you_do )
{
/* ?? Code to handle this button goes here */
ExitDialog =TRUE;
}
}
while (ExitDialog == FALSE);
/* Get results after dialog */
DisposDialog(GetSelection);
SetPort( saveport );
}